package com.meiyue.controller;

import com.meiyue.bean.entity.TestDriverLicenseTypesEntity;
import com.meiyue.bean.protocol.NetResult;
import com.meiyue.controller.interfaces.IDltController;
import com.meiyue.library.custom.controller.BaseKvController;
import com.meiyue.library.utils.ResultUtils;
import com.meiyue.service.DriverLicenseTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * MeiyueJavaProject
 * com.meiyue.controller
 * Created by Chris Chen
 * 2017/9/16
 * Explain:
 */
@RestController
@RequestMapping("/dlt")
public class DltController extends BaseKvController<TestDriverLicenseTypesEntity, Integer, DriverLicenseTypeService>
        implements IDltController {
    @Autowired
    DriverLicenseTypeService dltService;

    @Override
    public DriverLicenseTypeService getService() {
        return dltService;
    }

    @Override
    public NetResult<Boolean> addOneType(String type) {
        return ResultUtils.buildResult(dltService.addOne(new TestDriverLicenseTypesEntity(type)));
    }
}
